import React, { Component } from 'react'
import { NavBar, Icon } from 'antd-mobile';
import {withRouter} from "react-router-dom"
import "./brNav.scss"
class BrNav extends Component {
    render() {
        return (
            <div>
                <NavBar
                    mode="light"
                    // this.props.left 从父组件传过来，通过它来判断左边的返回需不需要加上
                    icon={this.props.left?<Icon type="left" />:""}
                    onLeftClick={() => {
                        if(this.props.left){
                            this.props.history.go(-1)
                        }
                    }}
                    // this.props.title 动态的更改导航标题
                >{this.props.title}</NavBar>
            </div>
        )
    }
}
export default withRouter(BrNav)